<?php
class MySmarty{
	var $smarty;
	function MySmarty($cache=false,$time=0,$moban='default'){
		include_once("smarty/Smarty.class.php");
		
		$NowPathArray=explode("model",str_replace("\\","/",dirname(__FILE__))) ; 
		@define("root_path", $NowPathArray[0]); 

		if($time==0){$time=3600;}else{$time*=3600;}
		
		$this->smarty = new Smarty;
		$this->smarty->compile_check = true;
		$this->smarty->debugging = false;
		$this->smarty->template_dir = root_path."templates/".$moban;
		$this->smarty->compile_dir = root_path."model/compile";
		$this->smarty->cache_dir = root_path."model/cache";
		$this->smarty->caching = $cache;
		$this->smarty->cache_lifetime = $time;
		$this->smarty->left_delimiter = "<{";
		$this->smarty->right_delimiter = "}>";
		
	}
	
	function get_smarty(){
		return $this->smarty;
	}
}
?>